package com.jgame.secondarymarket.interfaces.dto.product;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Set;

/**
 * @title: ProductDTO
 * @Author Wangsj
 * @Date: 2021/7/21
 */
@Data
@ToString
@ApiModel(description = "商品信息数据传输对象")
public class ProductDTO {

    @ApiModelProperty(value = "商品名称")
    @NotNull(message = "商品名称不能为空")
    private String name;

    @ApiModelProperty(value = "商品图片地址")
    @NotNull(message = "商品图片不能为空")
    private String imageAddress;

    @ApiModelProperty(value = "商品描述")
    private String describes;

    @ApiModelProperty(value = "商品一级分类")
    @NotNull(message = "商品一级分类称不能为空")
    private String categoryFist;

    @ApiModelProperty(value = "商品二级分类")
    @NotNull(message = "商品二级分类称不能为空")
    private String categorySecond;

    @ApiModelProperty(value = "商品属性")
    @NotNull(message = "每个商品至少需要一组商品属性")
    @Valid
    private Set<ProductPropertiesDTO> properties;


    @NotNull(message = "每个商品至少需要一个规格")
    @Valid
    private Set<SpecificationDTO> specifications;
}
